﻿using System.Drawing;
using System.IO;
using PlanningGIS.Framework;
using ESRI.ArcGIS.ADF.BaseClasses;
using PlanningGIS.CoordCovert.form;

namespace PlanningGIS.CoordCovert.button
{
    internal class  btnGeosocConvert2 : BaseCommand
    {
        FrmGeosocConvert2 myform;
        IApplication m_Application = null;
        public btnGeosocConvert2()
        {
            base.m_caption = "变形2";
            base.m_toolTip = base.m_caption;
        }

        public override void OnCreate(object hook)
        {
            m_Application = hook as IApplication;
        }


        public override bool Enabled
        {
            get
            {
                return (m_Application as IFramework).IsMapCtrlactive;
            }
        }

        public override void OnClick()
        {
            if ((m_Application as IFramework).IsMapCtrlactive)
            {
                if (myform == null || myform.IsDisposed)
                {
                    myform = new FrmGeosocConvert2(m_Application);
                }
                myform.Visible = false;
                myform.Show((m_Application as IFramework).MdiForm);
            }
        }
    }
}
